public class Solution136 {
    public int singleNumber(int[] nums) {
        int x=0;
        for (int num : nums) {
            x^=num;
        }
        return x;
    }

    public static void main(String[] args) {
        System.out.println(new Solution136().singleNumber(new int[]{2,2,1}));
    }
}
